VB .NET Web Apps1. You use Visual Studio .NET to create applications for a large Internet service organization that provides end-to-end web site design and hosting. You create an assembly that will reside on the IIS server. The assembly will be used by virtually all applications deployed on the server. You must ensure that any applications installed on the server will be able to access the assembly. (Choose all that apply) A. Use the SN.EXE utility to create a strong name. B. Install the application into the Global Assembly Cache. C. Copy the application into the Global Assembly Cache. D. Copy the application to the wwwroot folder on the web server. E. Ensure that when the assembly is deployed it does not deploy to the Global Assembly Cache.
2. You are working as a Visual Studio .NET consultant and your current contract has you implementing security for a large manufacturing organization, ACME Widgets. ACME has recently decided to standardize all development on the .NET framework. You need to configure role-based security for a component that will have three separate roles; Administration, DataEntry and ReadOnly. The roles will include individuals from separate groups in the corporate domain. How do you create the roles? (Choose all that apply) A. Create a package in Component Services on the computer that will house the application. B. Create the three roles and assign the necessary groups in the users folder. C. Create database roles on the SQL Server and assign the necessary groups. D. Have the application perform an Active Directory query for the user's group membership. E. Use the application role mechanisms in SQL Server.
3. You are working as a Visual Studio .NET consultant and you current contract has you implementing security for a large manufacturing organization, ACME Widgets. ACME has recently decided to standardize all development on the .NET framework. You need to configure security for a web site that is only to be accessed by individuals within the company. The company is standardized on Internet Explorer 6 as its web browser. What type of security should you implement? A. Custom application authentication. B. Microsoft Passport. C. Forms-based. D. No Authentication (None). E. Windows Authentication.
4. You are working as a Visual Basic .NET developer for a large Internet service organization that specializes in maintaining web sites for government offices. There are a considerable number of files requiring security against individuals who should not be viewing the information contained therein. One of the agencies reports that they cannot view data that should be available for public access. You verify the configuration settings and find the following entry in the Web config file: password="pass"/> You have strict instructions not to change any of the configuration files for the government web sites. How do you fix the problem? A. Check the NTFS permissions of the files and ensure that the PublicAccess user is permitted to read the files in question B. Check the Share permissions of the files and ensure that the PublicAccess user is permitted to read the files in question C. Check the Web Sharing permissions of the files and ensure that the PublicAccess user is permitted to read the files in question D. Configure the site in the IIS manager to allow anonymous access
5. You are developing a number of projects for a large manufacturing corporation, ACME Widgets. The system, when completed, will be integrated into a combination web-based and windows-based application environment. In the system you are using a 3-tier development process. Currently you are in the planning stages and you are attempting to determine for which application processes each program is to be responsible. You have a set of operations that will involve complex processing to determine the validity of the inputted data. Most of the required processing involves range checking. Where would these processes be performed? (Choose all that apply) A. In a component that will be accessed by both the Windows-based applications and the Internet server processed. B. Within the user interface of each application. C. In one component that will be accessed by the Windows-based applications and a second component accessed by the Internet server processed. D. As a stored procedure on a database serve. E. <!-- #include virtual = filename -->.
6. You are one of a team of Visual Studio .NET developers working for a large Internet service provider. The current project you are developing uses ASP.NET technologies to provide a web-based application for your clients to interact with their own web sites. You are implementing code that must run at the server as opposed to the client browser. Which techniques are used to implement server-side code? (Choose all that apply) A. <script runat="server" language="VB"> </script> B. <% Code goes here... %> C. <%-- Code goes here... --%> D. <object id="id" runat=server latebinding=true> E. <!-- #include virtual = filename -->
7. You are developing a number of projects for a large manufacturing corporation, ACME Widgets. The system, when completed, will be integrated into a combination web-based and windows-based application environment. In the system you are using a 3-tier development process. Currently you are in the planning stages and you are attempting to determine for which application processes each program is to be responsible. You have a set of operations that will involve complex processing to determine the validity of the inputted data. Most of the required processing involves range checking. Where would these processes be performed? A. As a stored procedure on a database serve. B. In a component that will be accessed by both the Windows-based applications and the Internet server processed. C. In one component that will be accessed by the Windows-based applications and a second component accessed by the Internet server processed. D. Within the user interface of each application.
8. You are developing a Web-based application that will serve up data items from a Microsoft SQL Server database that resides in your company's demilitarized zone. The application requires the alteration of items in a data list. The items must be wrapped on to the next line when the end of a cell is reached. Which of the following properties would be set? A. Set the Separator.Template property B. Set the SelectedItemStyle property C. Set the ItemTemplate property D. Set the Selected.ItemTemplate property E. Set the ItemStyle property F. Set the Separator.Style property
9. You are working on a large web-based integration project that will use a number of backend database resources to implement data queries along with standard add, change delete functionality. The application you are currently working with will use Web forms with a number of user controls. You have used the following code to access one of the controls: Public Class MyWebPage Inherits System.Web.UI.Page Protected myControl1 As WebUserControl1 How do you programmatically make the control visible? A. myControl1.Show B. WebUserControl1.Visible = True C. Controls on a Web form are always visible D. The visibility of Controls on a Web form always stays in their designed state E. MyControl1.Visible = True F. WebUserControl1.Show
10. You are working as a Visual Studio .NET developer for a large Internet service organization. Your recent project is an ASP.NET application that will be used by you company's clientele. You want to perform a series of initialization processes the first time your application is accessed by each client. Where should the initialization code be placed? A. Add code to the Session_OnStart event of the Global.asax file. B. Add code to the Application_OnStart event of the Global.asax file. C. Add code to the Form_Load event of the main project form. D. Add code to the Form_InitializeComponent event of the main project form.
11. You are a Visual Basic .NET developer who has been coding a Web application that will be used by a number of different cultures. You are in the final stages of localizing the product for each culture. You have the compiled application with support for Germany, Australia and Canada. You have set up the application to use the United States as a default culture. The team of developers with whom you work creates the necessary resource files. How do you now imbed a resource file into the assembly? A. Use the Resource File generator to imbed a resource file. B. Use the Assembly Linker to imbed a resource file. C. Use the Isolated Storage tool to embed a resource file. D. Use the Installer tool to imbed a resource file. E. Use the MSIL Assembler tool to imbed a resource file. F. Use the License Compiler to imbed a resource file.
12. You are developing an ASP.NET web application and you discover that none of the existing ASP.NET server controls meet the specific requirements of your application. You need to deploy the application quickly to service a web site that has already been in service. How should you develop the functionality? A. Create a Web custom control to encapsulate the functionality. B. Create a Web user control to encapsulate the functionality. C. Create an ActiveX control to encapsulate the functionality. D. Create a Web Service to encapsulate the functionality.
13. You work as a Visual Studio .NET developer for a large Internet service organization. You are training a new developer and need to explain the differences between Web User Controls and Web Custom Controls. Which of the following statements are true? (Choose all that apply) A. Web User Controls have limited design support while Web Custom Controls have full visual design support. B. Web user controls require a separate copy of the control in each application while Web custom controls require a single copy of the control for all applications. C. Web user controls cannot be added to the Toolbox in Visual Studio while Web custom controls can be added to the Toolbox. D. Web user controls can be added to the Toolbox in Visual Studio while Web custom controls cannot be added to the Toolbox. E. Web user controls require a single copy of the control for all applications while Web custom controls require a separate copy of the control for each application. F. Web User Controls have full visual design support while Web Custom Controls have limited design support.
14. You are working as a Visual Studio .NET developer for a large Internet service organization that specializes in end-to-end development and deployment of ecommerce web sites for small businesses. You are working on an ASP.NET application that is coded primarily in C# but are supplying a page of the application using Visual Basic .NET. What is needed to accommodate the functionality? A. Refer to the page in the Global.asa file as a VB pages B. This cannot be done, you must translate the page to C# C. Supply an @ Page directive indicating the language D. Use a separate Web.config file for the page that supplies the needed language information
15. You are developing an ASP.NET application for a large Internet service organization that provides end-to-end development, deployment and hosting of ecommerce web site for small businesses. You would like to send HTTP output that has been prepared from the sting concatenation of a number of elements to the user's browser. The output could potentially include formatting, hyperlinks and graphical material. What code would you implement? A. <% Response.Redirect (OutputToBrowser) %> B. <% Response.Redirect %> OutputToBrowser C. <% Response.Write %> OutputToBrowser D. <% Response.Write OutputToBrowser %>
16. You are working as a Visual Basic .NET developer for a large manufacturing company, ACME Widgets. You are developing a COM component that will be installed on an IIS server and accessed from an ASP.NET procedure. You need to create a custom event that will signal the ASP.NET application when the logon process has completed. Which of the following code fragments is the correct implementation? A. Event LogonCompleted(UserName As String) Sub LogonDone RaiseEvent LogonCompleted("Billy Bean") End Sub B. Friend WithEvents MyComponentImplemented As MyComponent Protected Sub MyComponentImplemented_LogonCompleted(UserName As String) Handles MyComponent.LogonCompleted 'Implementation code here EndSub C. AddHandler MyComponent.LogonCompleted, AddressOf Me.MyEventHandler Sub MyEventHandler() ' Implementation Code End Sub D. Sub TestEvents() Dim Obj As New MyComponent AddHandler Obj.LogonCompleted, AddressOf EventHandler Obj.LogonDone() RemoveHandler Obj.Ev_Event, AddressOf EventHandler End Sub
17. You are working as a Visual Basic .NET developer for a large manufacturing company, ACME Widgets. You are developing an ASP.NET applications that uses a COM component installed on an IIS server. You need to create an event handler that will write to the application log when the logon process has completed. Once the event has been handled you need to stop handling the events from the component. Which of the following code fragments is the correct implementation? A. Sub TestEvents() Dim Obj As New MyComponent AddHandler Obj.LogonCompleted, AddressOf MyEventHandler Obj.LogonDone() RemoveHandler Obj.Ev_Event, AddressOf MyEventHandler End Sub Sub MyEventHandler() ' Implementation Code End Sub B. Friend WithEvents MyComponentImplemented As MyComponent Protected Sub MyComponentImplemented_LogonCompleted(UserName As String) Handles MyComponent.LogonCompleted 'Implementation code here End Sub C. AddHandler MyComponent.LogonCompleted, AddressOf Me.MyEventHandler Sub MyEventHandler() ' Implementation Code End Sub D. Event LogonCompleted(UserName As String) Sub LogonDone RaiseEvent LogonCompleted("Billy Bean") End Sub
18. You are working as a member of a team of Visual Studio .NET developers for a large Internet service organization that provides end-to-end design and deployment of eCommerce web sites for a variety of small businesses. The current application that your team is working on requires the implementation of online user assistance. You plan to use an HTML help engine to provide assistance to the users. You would like first to display an HTML table of contents for the user. What code would provide this functionality? A. <OBJECT id=MyControl type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" codebase="HHCTRL.ocx#Version=4,72,8252,0" width=100% height=100%> <PARAM name="Command" value="Contents"> <PARAM name="Item1" value="C:\Mytoc.hhc"> <PARAM name="Flags" value="0x4000,0x800035> </OBJECT> B. <OBJECT id=MyControl type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" codebase="HHCTRL.ocx#Version=4,72,8252,0" width=100 height=100 > <PARAM name="Command" value="HH Version"> <PARAM name="Button" value="Text:Click for version number"> </OBJECT> C. <OBJECT id=MyControl type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" codebase="HHCTRL.ocx#Version=4,72,8252,0" width=100 height=100 > <PARAM name="Command" value="Index"> <PARAM name="Item1" value=".hhk file path"> </OBJECT> D. OBJECT id=MyControl type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" codebase="HHCTRL.ocx#Version=4,72,8252,0" width=100 height=100 > <PARAM name="Command" value="KLink, menu"> <PARAM name="Button" value="Text:Animal Diets"> <PARAM name="Item1" value="animals.chm"> <PARAM name="Item2" value="omnivore"> <PARAM name="Item3" value="carnivore"> </OBJECT>
19. You have developed an Interface for a customer object with the following code: Interface IcustomerInfo Property CustomerName() As String Sub UpdateCustomerStatus() Event UpdateComplete() End Interface You would like to extend the class so that you can have two different types of customer objects built off this basic template, one for service customers and one for product customers. How would you accomplish this? A. Create two new classes ProductCustomer and ServiceCustomer. Use the Implements statement to build upon the base Customer class. B. Create a new class for ProductCustomer use the Implements statement to build upon the base Customer class. Create a new class for ServiceCustomer use the Implements statement to build upon the ProductCustomer class. C. Create a new class for ServiceCustomer use the Implements statement to build upon the base Customer class. Create a new class for ProductCustomer use the Implements statement to build upon the ServiceCustomer class. D. Create two new classes ProductCustomer and ServiceCustomer. Copy the cope from the Customer class as a template to use in your two new classes.
20. You have developed an fully coded class for a customer object that has: Property CustomerName() As String Sub UpdateCustomerStatus() Event UpdateComplete() You would like to extend the class so that you can have two different types of customer objects built off this basic template, one for service customers and one for product customers. How would you accomplish this? A. Create two new classes and use the Implements statement to allow you to have access to the already coded customer class. B. Create two new classes and use the Inherits statement to allow you to have access to the already coded customer class. C. Create two new classes and use the Imports statement to allow you to have access to the already coded customer class. D. Create two new classes and use the Interface statement to allow you to have access to the already coded customer class.
21. You are creating a financial application that performs a number of complex calculations. The variable declarations for the program are as follows: Public I=1, J=2, K=3 As Integer Public S, SArray() As Short Public B1, B2 As Byte Public C1, C2 As Char You receive an error message when you execute the following command: B1 = I + J + K How can you correct the problem? A. Set Strict off B. Convert all numeric variables to Decimal C. Set Option Explicit on
22. You are troubleshooting the code from another member of your development team and notice the following results: Dim Names() As String = New String(3) {"Name0", "Name1", "Name2", "Name3"} MyArray = Names ' Fails at compile time. What is the cause of the problem? A. You must have the same number of entries when performing an array conversion B. Myarray is not declared C. Myarray is an object array D. Option Strict is set on
23. You are working as a developer for a hobby machinery manufacturer. Shizoo Manufacturing Inc. The company manufactures and sells a variety of snowmobiles and equipment as well in the future it plans on releasing the new Jezoo Sea Ski. The model will be available in standard colors. The application you are developing must present these colors on the interface upon selection from a dropdown list box. Which of the following would be used define a set of named constants for the color schemes? A. Public Enum InterfaceColors MistyRose = &HE1E4FF& SlateGray = &H908070& DeepSkyBlue = &HFFBF00& ForestGreen = &H228B22& End Enum B. Public Const InterfaceColors MistyRose = &HE1E4FF& SlateGray = &H908070& DeepSkyBlue = &HFFBF00& ForestGreen = &H228B22& End Const C. Public Sub InterfaceColors Const MistyRose = &HE1E4FF& Const SlateGray = &H908070& Const DeepSkyBlue = &HFFBF00& Const ForestGreen = &H228B22& End Sub D. Public Function InterfaceColors( Choice as string) As Color Select Case Choice Case "MistyRose" InterfaceColors = &HE1E4FF& Case "SlateGray" InterfaceColors = &H908070& Case "DeepSkyBlue" InterfaceColors = &HFFBF00& Case Else InterfaceColors = &H228B22& End Select End Function
24. You are a Visual Basic .NET developer on a team of Visual Studio .NET developers for a large manufacturing company, ACME Widgets. A member of your team has observed that within the files of the project are two similar files: displaydataresults.aspx displaydataresults.aspx.vb Which of the following most correctly describes the files? (Choose all that apply) A. The aspx file is the non-compiled language specific (C++) version of the file. B. The aspx.vb file is a code file. A code file contains code that interacts with the interface. C. The aspx file is the compiled version of the application. D. The aspx.vb file is the non-compiled language specific (Visual Basic) version of the file. E. The aspx file is the non-compiled language specific (C#) version of the file. F. The aspx file is a Web form. The Web form displays a user interface.
25. You are one of a team of Visual Studio .NET developers working for a large Internet service provider. The current project you are developing uses ASP.NET technologies to provide a web-based application for your clients to interact with their own web sites. You need to define page-specific compiler directives that are to be used on one specific page to indicate XML content. What directive would be used? A. <%@ Page Language="VB" ContentType="text/xml" %> B. <%@ Control Language="VB" EnableViewState="false" %> C. <%@ Reference Control="MyControl.ascx" %> D. <%# DataBinder.Eval(Container.DataItem, "IntegerValue", "{0:c}") %>
26. You are one of a team of Visual Studio .NET developers developing a Web application to allow clients to retrieve, edit and save data to a database located on a SQL Server located in your demilitarized zone. You need to optimize the performance of your application. How would you optimize the application? (Choose all that apply) A. Maintain session state information. B. Disable and state information not being used. C. Minimize use of server-side controls. D. Use server-side controls wherever possible. E. Minimize round trips to the server. F. Use more frequent communications between the client and server .
27. Your company uses ASP.NET applications to invoice customers over the Internet for purchases made online. You are in the planning stages of a data access module that will interact with a SQL Server database. The database maintains order information in two tables. The Invoice table maintains the general information about each invoice while the Invoice Details table contains the line item information for the invoice. The tables are related in a one-to-many relationship that is maintained by a foreign key. How would you develop the object model? A. Use a DataTable object, two DataSet objects and a single ForeignKeyConstraint object. B. Use two DataSet objects each containing a DataTable object and a single ForeignKeyConstraint object. C. Use a single DataSet object, two DataTable objects and a ConstraintCollection where the Foreign Key would be defined. D. Use a single DataSet object, two DataTable objects and a single ForeignKeyConstraint object.
28. Your company uses ASP.NET applications to invoice customers over the Internet for purchases made online. You are in the planning stages of a data access module that will interact with a SQL Server database. The database maintains order information in two tables. The Invoice table maintains the general information about each invoice while the Invoice Details table contains the line item information for the invoice. The tables are related in a one-to-many relationship that is maintained by a foreign key. How do you prevent cascading delete actions? A. Do nothing cascading deletions are not permitted. B. Set the PrimaryKey property of the Invoice table to a known column. C. The DeleteRule of a ForeignKeyConstraint object to none. D. Set the PrimaryKey property of the InvoiceDetails table to a combination of known columns. E. Use the Constraint property of the Invoice table to disallow the cascading action. F. Use the Constraint property of the Invoice Details table to disallow the cascading action.
29. You are working as a member of a development team creating a new application that will use an XML Web Service to supply data transmission. The user interface to run against the service is in the initial stages. You are working at home and have no access to the server that houses the Web Service; you do have a copy of the description file for the service. How can you produce the user interface? A. Use the Web Services Description Language tool to generate a proxy class for the service. B. Use the Web Services Discovery tool to generate a proxy class for the service. C. Use the Windows Forms Resource Editor tool to generate a proxy class for the service. D. Use the XML Schema Definition tool to generate a proxy class for the service. E. Use the Isolated Storage tool to generate a proxy class for the service. F. Use the Assembly Cache Viewer tool to generate a proxy class for the service.
30. You are one of a team of Visual Studio .NET developers working on a series of applications for a small retail chain. You develop an application that will enable users to retrieve information from a database via a Web-based application. The application must allow for standard query and add, change delete operations. You create an OLEDBDataAdapter using a SelectCommand property and a DataSet object in an ASP.NET application. How do you retrieve data and allow changes to be made? (Choose all that apply) A. Call DataSet.Update to save the changes B. Call DataAdapter.Fetch to populate the DataSet C. Call DataSet.GetChanges to save the changes D. Call DataSet.HasChanges to save the changes E. Call DataAdapter.Fill to populate the DataSet F. Call DataAdapter.Update to save the changes
31. You are a Visual Basic .NET developer for large Internet service company that provides end-to-end web deployment services. You are in the process of creating an ASP.NET application. The application is used to provide customer account information. The application communicates with a server within the corporate demilitarized zone. There are multiple instances of SQL Server running on the machine. You need to provide a connection string that will access Customer database on the EXTERNAL instance of SQL Server. What is the correct connection string? A. Provider=SQLOLEDB;Data Source=DMZSQL1\External;Initial Catalog=Customer;Integrated Security=SSPI B. Provider=SQLOLEDB;Data Source=DMZSQL1;Initial Catalog=External/Customer;Integrated Security=SSPI C. Provider=SQLOLEDB;Data Source=External;Initial Catalog=Customer;Integrated Security=SSPI D. Provider=SQLOLEDB;Data Source=DMZSQL1;Initial Catalog=Customer;Integrated Security=SSPI E. Data Source=DMZSQL1/External;Initial Catalog=Customer;Integrated Security=SSPI
32. You are a new developer joining a team of Visual Studio .NET developers working with a large Internet service company that performs end-to-end services for web site hosting. You have taken over an application from a previous developer who is no longer working with the company. A segment of code that you are parsing is as follows: sub Page_Load(sender as Object, e as EventArgs) dim doc as XPat hDocument = new XPathDocument(Server.MapPath("books.xml")) dim xslt as XslTransform = new XslTransform() xslt.Load(Server.MapPath("output.xsl")) xslt.Transform(doc, nothing, Response.OutputStream) end sub What is the purpose of the code? A. Transforms HTML to XML within an ASP.NET page B. Retrieves XML data from a SQL Server database C. Sends XML data to a SQL Server database D. Transforms XML to HTML within an ASP.NET page
33. You are working as a Visual Studio .NET developer for a large manufacturing company, ACME Widgets. You are developing an ASP.NET application that will receive data from an application and must create a file containing data in the form of XML. What code will send the XML data to a file? A. Private Sub WriteXmlToFile(thisDataSet As DataSet) Dim filename As String = "myXmlDoc.xml" Dim myFileStream As New System.IO.FileStream _ (filename, System.IO.FileMode.Create) Dim myXmlWriter As New System.Xml.XmlTextWriter _ (myFileStream, System.Text.Encoding.Unicode) thisDataSet.WriteXml(myXmlWriter) myXmlWriter.Close() End Sub B. Private Sub WriteXmlToFile(thisDataAdapter As DataAdapter) Dim filename As String = "myXmlDoc.xml" Dim myFileStream As New System.IO.FileStream _ (filename, System.IO.FileMode.Create) Dim myXmlWriter As New System.Xml.XmlTextWriter _ (myFileStream, System.Text.Encoding.Unicode) thisDataAdapter.WriteXml(myXmlWriter) myXmlWriter.Close() End Sub C. Private Sub WriteXmlToFile(thisDataSet As DataASet) FileOpen(1, "c:\myXMLData.txt", OpenMode.Binary) FilePutObject(1, thisDataSet) FileClose(1) End Sub D. Sub WriteXMLToFile(thisDataSet As DataSet) FileOpen(1, "C:\XMLData.txt", OpenMode.Binary) FilePut(1, thisDataSet) FileClose(1) End Sub
34. You are using ASP.NET and ADO.NET to create an application for your Internet service company. You would like the application to execute set of stored procedures that perform a variety of operations against a Microsoft SQL Server database that is located in the corporate demilitarized zone. You are using an OleDbConnection object to connect to the database and an OleDbCommand object to execute the procedures. You need to cancel any changes made to the data upon the occurrence of an error. You write error code that will catch an error if it does occur. Which of the following code segments accommodates these requirements? A. Public Sub RunOleDbTransaction(myConnString As String) Dim myConn As New OleDbConnection(myConnString) myConn.Open() Dim myComm As New OleDbCommand() Dim myTran As OleDbTransaction myTrans = myConn.BeginTransaction(IsolationLevel.ReadCommitted) myComm.Connection = myConn myComm.Transaction = myTrans Try myComm.CommandText = "InReg (RegID, RegDesc) VALUES (100, 'Description')" myComm.ExecuteNonQuery() myComm.CommandText = "InReg (RegID, RegDesc) VALUES (101, 'Description')" myComm.ExecuteNonQuery() myTran.Commit() Catch e As Exception myTran.Rollback() Finally myConn.Close() End Try End Sub B. Public Sub RunOleDbTransaction(myConnString As String) Dim myConn As New OleDbConnection(myConnString) myConn.Open() Dim myComm As New OleDbCommand() Dim myTran As OleDbTransaction myComm.BeginTransaction myComm.Transaction = myTrans Try myComm.CommandText = "InReg (RegID, RegDesc) VALUES (100, 'Description')" myComm.ExecuteNonQuery() myComm.CommandText = "InReg (RegID, RegDesc) VALUES (101, 'Description')" myComm.ExecuteNonQuery() myTran.Commit() Catch e As Exception myTran.Rollback() Finally myConn.Close() End Try End Sub C. Public Sub RunOleDbTransaction(myConnString As String) Dim myConn As New OleDbConnection(myConnString) myConn.Open() Dim myComm As New OleDbCommand() Dim myTran As OleDbTransaction myTrans.BeginTransaction(IsolationLevel.ReadCommitted) myComm.Connection = myConn myComm.Transaction = myTrans Try myComm.CommandText = "InReg (RegID, RegDesc) VALUES (100, 'Description')" myComm.ExecuteNonQuery() myComm.CommandText = "InReg (RegID, RegDesc) VALUES (101, 'Description')" myComm.ExecuteNonQuery() myTran.Commit() Catch e As Exception myTran.Rollback() Finally myConn.Close() End Try End Sub D. Public Sub RunOleDbTransaction(myConnString As String) Dim myConn As New OleDbConnection(myConnString myConn.Open() Dim myComm As New OleDbCommand() Dim myTran As OleDbTransaction myComm = myConn.BeginTransaction(IsolationLevel.ReadCommitted) myComm.Connection = myConn myComm.Transaction = myTrans Try myComm.CommandText = "InReg (RegID, RegDesc) VALUES (100, 'Description')" myComm.ExecuteNonQuery() myComm.CommandText = "InReg (RegID, RegDesc) VALUES (101, 'Description')" myComm.ExecuteNonQuery() myTran.Commit() Catch e As Exception myTran.Rollback() Finally myConn.Close() End Try End Sub
35. You are a Visual Basic .NET developer for a large Internet service organization that specializes in the storage of data warehouses and the development of applications to serve up the data over the Internet. You company is standardized on the .NET Framework development environment and uses a series of SQL Server 2000 machines to house all data. You are currently creating an ASP.NET application that will allow a user to request information and display the results in a DataGrid. You use a SqlConnection object and would like the data returned to the user as quickly as possible. How should you implement the requested functionality? A. Create a stored procedure that retrieves the data from the database and filter the data using a standard query. B. Query the database using an SQL string that is built from the concatenated elements provided by the user. C. Create a stored procedure that accepts an Input parameter and have the application call the procedure. D. Have a query retrieve all data from the table using a Select operation and have the application filter the data.
36. You are working for a large Internet service organization that supplies end-to-end web site development and deployment services. The application you are currently creating a will use XML documents to provide screenplay scenarios to actors and other industry individuals across the Internet. The documents contain instructions for the stage hands as well as other non-spoken directions. You are creating a procedure to extract information from these XML documents depending upon the individual needs of the user. The XML document will be sent as a file to the browser. The information is then displayed in on web pages that take on the appearance of the venue where the play is being presented. A user will make a request and you then need the results of these requests to be returned as quickly as so that they can be rendered by the client side application. How should you code the retrieval of data? A. Dim mySelectQuery as string = Request.Form("sqlQueryBuilt") Dim myConnectString as string = "server=localhost;Integrated _ Security=True;database=myDatabase" Dim sqlConn as SqlConnection = new SqlConnection( myConnectString ) sqlConn.Open() Dim sqlComm as SqlCommand = new SqlCommand( mySelectQuery , sqlConn) Dim reader as XmlTextReader = _ CType(sqlComm.ExecuteXmlReader(),XmlTextReader) Dim doc as XPathDocument = new XPathDocument(reader, XmlSpace.Preserve) B. Dim mySelectQuery as string = Request.Form("sqlQueryBuilt") Dim myConnectString as string = "server=localhost;Integrated Security=True;database=myDatabase" Dim sqlConn as SqlConnection = new SqlConnection( myConnectString ) sqlConn.Open() Dim sqlComm as SqlCommand = new SqlCommand(mySelectQuery , sqlConn) Dim reader as XmlTextReader = CType(sqlComm.ExecuteXmlReader(),XmlTextReader) Dim doc as XMLDocument = new XMLDocument C. Dim mySelectQuery as string = Request.Form("sqlQueryBuilt") & " For XML Auto" Dim myConnectString as string = "server=localhost;Integrated Security=True;database=myDatabase" Dim sqlConn as SqlConnection = new SqlConnection( myConnectString ) sqlConn.Open() Dim sqlComm as SqlCommand = new SqlCommand( mySelectQuery , sqlConn) D. Dim mySelectQuery as string = Request.Form("sqlQueryBuilt") & " For XML Auto" Dim myConnectString as string = "server=localhost;Integrated Security=True;database=myDatabase" Dim sqlConn as SqlConnection = new SqlConnection( myConnectString ) sqlConn.Open() Dim sqlComm as SqlCommand = new SqlCommand( mySelectQuery , sqlConn) Dim reader as XmlTextReader =_ CType(sqlComm.ExecuteXmlReader(),XmlTextReader) Dim doc as XPathDocument = new XPathDocument(reader, XmlSpace.Preserve)
37. You are working for a large Internet service organization that offers its clientele end-to-end web site developing and hosting. You are creating a Web Forms application that will be used to display customer information from a Microsoft SQL Server database. The form will allow the customer to change their information. The form consists solely of HTML type controls. During testing you notice that if the user types in a new password it is displayed on the screen. You would like to display a series of asterisks. How do you implement this functionality? A. On the HTMLInputTextControl use: <input type = password> B. You can't perform the functionality unless you use Web server controls C. Create client side code to trap the keystrokes and display asterisks instead D. Create server side code to trap the keystrokes and display asterisks instead
38. You are working as a member of a consulting team that is currently working with Visual Studio .NET to provide integration services for several business that are partnering to provide a series of services for the business traveler. All of the companies have agreed upon a standardized schema for the XML that they will use to exchange data between the firms. You have created a DataSet object named transferDS. You are now writing code to create an output file. What code fragment should you use? A. Transfer.WriteXml ("Transfer.XML", XMLWritemode.WriteSchema) B. Transfer.WriteXml ("Transfer.XML", XMLWritemode.DiffGram) C. transfer.WriteXml ("Transfer.XML", XMLWritemode.IgnoreSchema) D. Transfer.WriteXmlSchema ("Transfer.XSD")
39. You are working as a member of a consulting team that is currently working with Visual Studio .NET to provide integration services for several business that are partnering to provide a series of services for the business traveler. All of the companies have agreed upon a standardized schema for the XML that they will use to exchanges data between the firms. You have created a DataSet object named transferDS. You are now writing code to retrieve an XML data file called Transfer.XML. What code fragment should you use? A. transferDS.ReadXML("Transfer.XML", XMLReadMode.ReadSchema) B. transferDS.ReadXML("Transfer.XML", XMLReadMode.DiffGram) C. transferDS.ReadXML("Transfer.XML", XMLReadMode.InferSchema) D. transferDS.ReadXML("Transfer.XML", XMLReadMode.Fragment)
40. You are working as a member of a team of developers that use Visual Studio .NET to create applications for a large manufacturing firm, ACME Widgets. ACME is in the process of deploying a large ecommerce web site that will allow them to market their Widgets over the Internet. Your team is creating an ASP.NET application for the company as part of this process. The application will be deployed in a protected are of the web site that only company employees can access. Data entry clerks will use your application to add new Widgets to the site. They will also use the application to make changes to existing data and delete obsolete information. When data is changed or deleted the old data must be saved into an Archive table stored on the same SQL Server that houses the Widgets table. An entire row will be written to the table even if the change is on a singular field. Which code segment would you use to add the archive data? A. Dim myCommand As SqlCommand Dim insertCmd As String insertCmd = "insert into Archive values (@WidId, @Price, @Weight, @Metal);" myCommand = New SqlCommand(insertCmd, myConnection) myCommand.Parameters.Add(New SqlParameter("@WidId", SqlDbType.Char, 7)) myCommand.Parameters("@Id").Value = WidID.Value myCommand.Parameters.Add(New SqlParameter("@Price", SqlDbType.Decimal, 40)) myCommand.Parameters("@LName").Value = Price.Value myCommand.Parameters.Add(New SqlParameter("@Weight", SqlDbType.Decimal, 20)) myCommand.Parameters("@FName").Value = Weight.Value myCommand.Parameters.Add(New SqlParameter("@Metal", SqlDbType.VarChar, 25)) myCommand.Parameters("@Phone").Value = Metal.Value myCommand.Connection.Open() myCommand.Connection.Close() B. Dim myCommand As SqlCommand Dim insertCmd As String insertCmd = "Update Archive Set WidID=@WidId, Price=@Price, Weight=@Weight, Metal=@Metal);" myCommand = New SqlCommand(insertCmd, myConnection) myCommand.Parameters.Add(New SqlParameter("@WidId", SqlDbType.Char, 7)) myCommand.Parameters("@Id").Value = WidID.Value myCommand.Parameters.Add(New SqlParameter("@Price", SqlDbType.Decimal, 40)) myCommand.Parameters("@LName").Value = Price.Value myCommand.Parameters.Add(New SqlParameter("@Weight", SqlDbType.Decimal, 20)) myCommand.Parameters("@FName").Value = Weight.Value myCommand.Parameters.Add(New SqlParameter("@Metal", SqlDbType.VarChar, 25)) myCommand.Parameters("@Phone").Value = Metal.Value myCommand.Connection.Open() myCommand.Connection.Close() C. Dim myCommand As SqlCommand Dim insertCmd As String myCommand.Connection.Open() insertCmd = "insert into Archive values (@WidId, @Price, @Weight, @Metal);" myCommand = New SqlCommand(insertCmd, myConnection) myCommand.Parameters.Add(New SqlParameter("@WidId", SqlDbType.Char, 7)) myCommand.Parameters("@Id").Value = WidID.Value myCommand.Parameters.Add(New SqlParameter("@Price", SqlDbType.Decimal, 40)) myCommand.Parameters("@LName").Value = Price.Value myCommand.Parameters.Add(New SqlParameter("@Weight", SqlDbType.Decimal, 20)) myCommand.Parameters("@FName").Value = Weight.Value myCommand.Parameters.Add(New SqlParameter("@Metal", SqlDbType.VarChar, 25)) myCommand.Parameters("@Phone").Value = Metal.Value myCommand.Connection.Close() D. Dim myCommand As SqlCommand Dim insertCmd As String MyCommand.Connection.Open()insertCmd = "Update Archive Set WidID=@WidId, Price=@Price, Weight=@Weight, Metal=@Metal);" myCommand = New SqlCommand(insertCmd, myConnection) myCommand.Parameters.Add(New SqlParameter("@WidId", SqlDbType.Char, 7)) myCommand.Parameters("@Id").Value = WidID.Value myCommand.Parameters.Add(New SqlParameter("@Price", SqlDbType.Decimal, 40)) myCommand.Parameters("@LName").Value = Price.Value myCommand.Parameters.Add(New SqlParameter("@Weight", SqlDbType.Decimal, 20)) myCommand.Parameters("@FName").Value = Weight.Value myCommand.Parameters.Add(New SqlParameter("@Metal", SqlDbType.VarChar, 25)) myCommand.Parameters("@Phone").Value = Metal.Value myCommand.Connection.Close()
41. You are using Visual Basic .NET to develop a Web-based application for a large Internet service company. The organization is standardized on the .NET framework for its development of all applications. When debugging your application you would like to show the debug messages in the Windows event log. What interaction allows for this functionality? A. DefaultTraceListener B. TextWriterTraceListener C. Use the .NET SDK debugger D. Throw errors as System.Exception types E. EventLogTraceListener
42. You are working as a member of a Visual Studio .NET development team for a large Internet service provider. The company assists in the design and end-to-end operation of Internet web sites. You are in the process of creating a web application that will use the ASP.NET technology to operate the site over the Internet. You are designing the interface to use customized messages and log those messages as they occur. You would like the same messages to be used over the entire application. How do you accommodate the requirements? (Choose all that apply) A. Create a customErrors section in the Web.config file. B. Implement the Page_error evento handler. C. Inherit from the Soap.Extensions interface to implement error handling. D. Enable a @Page trace. E. Create an Application_Error procedure in the Global.asax file.
43. You are one of the primary developers for a large international corporation with offices in Germany, Canada, Australia and the United States. You have created a simple class library project that will be used by other developers in your company. One of your peer developers Joe is using your class in an ASP.NET application. After the application is deployed Joe places the .dll of your class library into the \bin folder of the ASP.NET application and registers the .dll. Joe then informs you that he is having problems stepping through the code of the class. How do you ensure that Joe can step through the code? A. Set the Active Solution Configuration and Project Configuration option to Debug before building. B. Ensure that Joe has a copy of the source code. C. Have Joe log on to the development machine and build the class. D. Have Joe check the code out using Visual Source Safe.
44. You are working as a Visual Studio .NET developer for a large manufacturing firm, ACMS Widgets. You are implementing debugging of you application CountWidgets using the TraceSwitch class and need to alter some of the trace settings. How do you change your trace preferences? A. Edit the Web.config file. B. Edit the CountWidgets.config file. C. Edit the Machine.config file. D. Edit the solution configuration file. E. Edit the project configuration file.
45. You use Visual Studio .NET to create applications for a large law firm. You have a complex class application that contains several functions, variables and objects. You need to debug the application, so you create a breakpoint at the top of one of the functions. You now need to examine the contents of the variables as they change throughout the scope of the current function. How should you examine the variables? A. Using the Properties Window B. Using the Locals Window C. Using the Resource View D. Using the Class View E. Using the Task List F. Using the Object Browser
46. You are working as a member of a Visual Studio .NET consulting team. Another member of your team has created an application. You are performing some testing on the application when you notice errors occurring. You create a Boolean variable called errorFlag and want to have a partial line written to a trace listener if the errorFlag is on. Which code should you use? A. Trace.WriteIf(errorFlag, "Error in AppendData procedure.") B. Trace.Assert(errorFlag, "Error in AppendData procedure") C. Debug.WriteIf(errorFlag, "Error in AppendData procedure") D. Trace.Write("Error in AppendData procedure") E. Trace.WriteLineIf(errorFlag, "Error in AppendData procedure.") F. Trace.WriteLine("Error in AppendData procedure.")
47. You are working as a member of a Visual Studio .NET consulting team. Another member of your team has created an application. You are performing some testing on the application when you notice errors occurring. You create a Boolean aswitch called errorFlag and want to have a full line written to a trace listener if the errorFlag is on. Since there will be a number of these operations you need to provide the best degree of performance possible. What code would you implement? A. If errorFlag.Enabled Then Trace.WriteLine("Error 42 occurred") End If B. Trace.WriteLineIf(errorFlag.Enabled, "Error 42 Occurred") C. Trace.WriteIf(errorFlag.Enabled, "Error 42 Occurred") D. Trace.WriteLine("Error 42 Occurred")
48. You are one of a team of developers that use Visual Studio .NET to create Internet based applications. The completed applications will be deployed over the Internet. Customers will download the generic version of the software that has certain restrictions in place until licensed by the user. You want customers to be able to verify the software you develop to provide a guarantee that the software is authentic. What should you do? (Choose all that apply) A. Issue a Software Publisher Certificate from a Windows 2000 certificate authority in your company. B. Use the strong name tool against the portable executable file. C. Purchase a Software Publisher Certificate from a certificate authority. D. Use the Signcode tool against the portable executable file. E. Use the type library exporter tool to against the portable executable.
49. You are working as a Visual Basic .NET developer for a large Internet service organization. You are in the deployment phase of an ASP.NET application. The application contains a component called ReleaseMe. This component is to be shared with other applications to be installed on one of the corporate Web servers. You need to deploy the ReleaseMe component so that the application can be uninstalled later. How do you create the installer? A. Create a web setup package and add a merge module for the component. B. Create a merge module project for the deployment of the application and component files. C. Create a standard web setup project for the application and component. D. Create a standard setup project for the application and add a merge module project for the component.
50. You are creating an ASP.NET application for a large Internet service company that provides end-to-end design and deployment of ecommerce web sites for its clientele. Often the user will navigate away from your web site. At this point you post back to the calling page and would like to submit user information to the TimeClockLeave.aspx page. You need to have information sent from the browser with no feedback to the user. How do you supply this functionality? A. Server.Execute( TimeClockLeave.aspx) B. Session.Abandon(TimeClockLeave.aspx) C. Response.AppendToLog(TimeClockLeave.aspx) D. Request.BinaryRead(TimeClockLeave.aspx)
51. You are in the deployment planning stage of application development for an ASP.NET application. The application is to be deployed over the company's intranet. The application uses a Web-based interface to provide data to the users from a Microsoft SQL Server database. You want to ensure efficient use of resources so you plan to utilize connection pooling. What is the best approach? A. Use Windows authentication and a single account for all users. B. Use SQL Server authentication with separate accounts for each user. C. Use SQL Server authentication with all users accessing the database with the SA account. D. Use Windows authentication and a separate account for each user.
52. You are developing an ASP.NET application for a large international currency exchange company. The company has branches in the United States, Australia, Canada and Germany. You need to provide globalization settings for the separate countries. Each branch of the company will deploy the application separately. The application must properly display data for each culture. How do you configure the application? A. Set the globalization element in a single Web.config file to the set of CultureInfo settings for all deployment regions. B. Set the Web.UI.Design element to a DesignTimeDataClass to a separate DesignTimeDataMember for each of the deployments. C. Set the Web.UI.Design element to a DesignTimeDataClass to a set of DesignTimeDataMember elements to cover all deployments. D. Set the Web.Services.Description element to an ImportCollection that contains a set of elements to cover all deployments. E. Set the Web.Services.Description element to a separate Import element of each of the deployments. F. Set the globalization element in four separate Web.config files to the corresponding CultureInfo setting for the deployment region.
53. You are developing an ASP.NET application for a large international currency exchange company. The company has branches in the United States, Australia, Canada and Germany. You need to provide globalization settings for the separate countries. Each branch of the company will deploy the application separately. The application must properly display data for each culture. How do you configure the application? A. Set the globalization element in the Web.config file to the deployment cultures: en-US, en-AU, en-CA, en-DE B. Set the globalization element in the Web.config file to the deployment cultures; US, AU, CA, DE X. Set the globalization element in the Web.config file to the deployment cultures: en-EN, de-DE D. Set the globalization element in the Web.config file to the deployment cultures; EN, DE E. Set the globalization element in the Web.config file to the deployment cultures: en-US, de-DE F. Set the globalization element in the Web.config file to the deployment cultures: en-US, en-AU, en-CA, de-DE
54. You are a developer on a team of Visual Studio .NET developers. Several applications that have been developed in the past within the company have run into problems due to the fact that the applications were not globally unique and often conflicted with each other. You are deploying an assembly and want to ensure its uniqueness. How is this accomplished? (Choose all that apply) A. Use the Strong Name tool against the assembly. B. Use the File Signing tool against the assembly. C. Use the Certificate Verification tool against the assembly. D. Use the Native Image Generator tool against the assembly.
55. You are a developer on a team of Visual Studio .NET developers. You need to guarantee that an assemble you are currently building is available to all applications on the server where it is deployed. How would this be performed? A. Do nothing special the assembly when deployed is available to all applications. B. Global Assembly Cache tool against the assembly. C. Use RegSvr32.exe to register the assembly. D. Use the .NET Framework tool against the assembly.
56. You are working as a member of a team of Visual Studio .NET developers for a large manufacturing firm, ACME Widgets. Your corporate web servers have a complex structure of folders and subfolders where the development team deploys its applications. You deploy an application and want to ensure that none of its configuration settings are changed by another developer's settings. How would you implement this functionality? A. Deploy your application to an existing folder and configure the Web.config file such that the settings cannot be overridden. B. Altering the settings of a Machine.config file should be performed with caution. Your settings may affect another application. C. Deploy your application to its own folder and configure the Web.config file such that the settings cannot be overridden. D. Deploy your application to its own folder and configure the Machine.config file such that the settings cannot be overridden.
57. You are working as a member of a team of Visual Studio .NET developers for a large manufacturing firm, ACME Widgets. Your corporate web servers have a complex structure of folders and subfolders where the development team deploys its applications. You deploy an application to its own folder and need to implement a custom error message. Specifically you would like to redirect the user to a specialized page. What code would you use to implement the message? A. In the Web.config file place: <customErrors ode="RemoteOnly" defaultRedirect="Customerror.aspx"> <error statusCode="404" redirect="Notfound.aspx" /> </customErrors> B. In the Machine.config file place: <customErrors ode="RemoteOnly" defaultRedirect="Customerror.aspx"> <error statusCode="404" redirect="Notfound.aspx" /> </customErrors> C. On the corporate SQL Server provide an alert that traps the message and redirects the user accordingly. D. Provide a Response.Redirect to the required page fired by the post operation.
58. You are one of the primary Visual Basic .NET developers working on a Visual Studio .NET development team for a large manufacturing corporation, ACME Widgets. You are currently testing an application that was created by another member of the development team. The application connects to a Microsoft SQL Server database. You notice that during certain conditions errors occur during the execution of a stored procedure. You need to add error-handling code to the application to capture information about any stored procedure that fails. How do you implement the error handling? A. Use a Try ... Catch block to trap SQLException errors. B. Use an On Error expression to trap SQLException errors. C. Use a Try ... Catch block to trap DataException errors. D. Use an On Error expression to trap DataException errors.
59. You are creating a financial application that performs a number of complex calculations. The variable declarations for the program are as follows: Public I=1, J=2, K=3 As Integer Public S, SArray() As Short Public B1, B2 As Byte Public C1, C2 As Char You receive an error message when you execute the following command: B1 = I + J + K How can you correct the problem? A. Set Option Explicit on B. Convert all numeric variables to Decimal C. Set Strict off
60. You are working as a developer for a hobby machinery manufacturer. Shizoo Manufacturing Inc. The company manufactures and sells a variety of snowmobiles and equipment as well in the future it plans on releasing the new Jezoo Sea Ski. The model will be available in standard colors. The application you are developing must present these colors on the interface upon selection from a dropdown list box. Which of the following would be used define a set of named constants for the color schemes? A. Public Const InterfaceColors MistyRose = &HE1E4FF& SlateGray = &H908070& DeepSkyBlue = &HFFBF00& ForestGreen = &H228B22& End Const B. Public Sub InterfaceColors Const MistyRose = &HE1E4FF& Const SlateGray = &H908070& Const DeepSkyBlue = &HFFBF00& Const ForestGreen = &H228B22& End Sub C. Public Function InterfaceColors( Choice as string) As Color Select Case Choice Case "MistyRose" InterfaceColors = &HE1E4FF& Case "SlateGray" InterfaceColors = &H908070& Case "DeepSkyBlue" InterfaceColors = &HFFBF00& Case Else InterfaceColors = &H228B22& End Select End Function D. Public Enum InterfaceColors MistyRose = &HE1E4FF& SlateGray = &H908070& DeepSkyBlue = &HFFBF00& ForestGreen = &H228B22& End Enum
|